Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class-declaration-abstractness-changed #974

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Mamatha1718
Copy link

@Mamatha1718 Mamatha1718 commented Dec 21, 2024

Title

class-declaration-abstractness-changed #974

See our DEVELOPERS guide below:
https://github.com/accordproject/concerto/blob/main/DEVELOPERS.md

Closes #974

Summary

This pull request introduces abstractness checks for class declarations to enhance compatibility and versioning analysis.

Changes

=> Added logic to compare isAbstract property in class declarations.
=> Retained existing type-change reports for class declarations.
=> Introduced new keys:
=> class-declaration-abstract-to-concrete: Classified as a minor change.
=> class-declaration-concrete-to-abstract: Classified as a major change.
=>Updated rules in compare-config.ts to reflect the above changes.+

Flags

=> Ensure the abstractness change handling aligns with other compatibility rules.
=> Breaking changes introduced by concrete-to-abstract modifications must be validated thoroughly.

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

Copy link

@DS-AdamMilazzo DS-AdamMilazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure the Concerto team would like to see something in the PR description.

@@ -54,11 +54,17 @@ const classDeclarationTypeChanged: ComparerFactory = (context) => ({
if (aType === bType) {
return;
}
context.report({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing type-change report shouldn't be removed. Instead, the if statement above should be inverted (aType !== bType or whatever) and the report should be put in there.

const changeSeverity = isAbstract(a) ? 'minor' : 'major';
context.report({
key: 'class-declaration-abstractness-changed',
message: `The class "${a.getName()}" changed from ${changeType} (${changeSeverity} change).`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The severity can't simply be expressed in the message but must be defined here:

You'll need to create two different keys: one for abstract to concrete, and one for concrete to abstract.

Copy link
Author

@Mamatha1718 Mamatha1718 Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the rules, and change the severity to changeKey.
The pull request is ready for review.
please let me know if any changes need.

@DS-AdamMilazzo
Copy link

It looks okay to me, but I'm not part of the Concerto team so they'll have to review it. I expect they would like to see a test, for example. I think you can search for the other result codes (keys) and find where the existing tests are.

@Mamatha1718
Copy link
Author

Mamatha1718 commented Dec 22, 2024 via email

@Mamatha1718
Copy link
Author

Mamatha1718 commented Dec 22, 2024 via email

@DS-AdamMilazzo
Copy link

I’m really interested in contributing to the Accord project, especially for GSoC 2025.

Thank you. I'm not part of the Accord/Concerto team, but I'd recommend asking @dselman or @mttrbrts, who are the principals behind it.

@sanketshevkar
Copy link
Member

Hi @Mamatha1718
Thanks for showing your interest. Can you please update your PR motivations and details in the description box?

I might also want to do a DCO signoff for your commits.

@@ -53,6 +53,8 @@ export const defaultCompareConfig: CompareConfig = {
'optional-property-added': CompareResult.PATCH,
'required-property-removed': CompareResult.MAJOR,
'optional-property-removed': CompareResult.MAJOR,
'class-declaration-abstract-to-concrete': CompareResult.MINOR,
'class-declaration-concrete-to-abstract': CompareResult.MAJOR,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we decide if the conversions results in a major/minor bump? Is there some sort of modelling convnetion for this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's major if existing data can become invalid (i.e. it's not backward-compatible). Otherwise, it's minor or patch. I don't know how they decide between those two. @mttrbrts ?

@Mamatha1718
Copy link
Author

Hi @Mamatha1718 Thanks for showing your interest. Can you please update your PR motivations and details in the description box?

I might also want to do a DCO signoff for your commits.
Hi @sanketshevkar,
I change PR description, Will you please let me know any other changes required.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants